#include "globalVariables.h"

int GUILeftButtonDown()
{
	//button
	if (!isSceneChanging && !isTurnChanging)
	{
		for (Button* buttonptr : *currentButtonList)
		{
			if (mouseX >= buttonptr->x && mouseX <= buttonptr->x + buttonptr->width
				&& mouseY >= buttonptr->y && mouseY <= buttonptr->y + buttonptr->height)
			{
				buttonptr->isPressed = true;
			}
		}
	}
	
	return 0;
}

int GUILeftButtonUp()
{
	//button
	for (Button* buttonptr : *currentButtonList)
	{
		if (buttonptr->isPressed)
		{
			buttonptr->isPressed = false;
			if (buttonptr->function)
			{
				buttonptr->function();
			}
		}
	}

	return 0;
}